The shift to Reactive Programming represents a fundamental transition from imperative, pull-based logic to a declarative, push-based paradigm centered on asynchronous data streams. It is a direct response to the inefficiencies of traditional "thread-per-request" models.
1. Moving Beyond Blocking I/O
In traditional systems, threads often sit idle—wasting CPU resources—while waiting for responses from databases or remote APIs. Reactive programming adopts an event-driven architecture where the application reacts to signals (data, errors, or completion) as they occur.
2. Data-at-Rest vs. Data-in-Motion
Instead of describing how to perform steps sequentially, developers define what should happen when an event travels through a stream. Changes propagate automatically through the system.
As shown above, when Thread 2 enters a Blocking I/O state (shaded red), it cannot yield, preventing Stream 3 from being processed even though the thread is technically "assigned."